<template>
  <div>
    <el-dialog title="外借详情" :visible.sync="$parent.open" width="70%">
      <div class="center_dialog">
        <el-divider>申请信息</el-divider>
        <el-descriptions :colon="false" title="" direction="vertical" :column="6" border>
          <el-descriptions-item label="外借单号">{{ allocation.borrowNum || '-' }}</el-descriptions-item>
          <el-descriptions-item label="提交时间">{{ allocation.createTime || '-' }}</el-descriptions-item>
          <el-descriptions-item label="外借人">{{ allocation.borrowerName || '-' }}</el-descriptions-item>
          <el-descriptions-item label="外借部门">{{ allocation.borrowDeptName || '-' }}</el-descriptions-item>
          <el-descriptions-item label="外借时间">{{ allocation.borrowTime || '-' }}</el-descriptions-item>
          <el-descriptions-item label="外借说明">{{ allocation.explanation || '-' }}</el-descriptions-item>
        </el-descriptions>
        <el-divider>相关附件</el-divider>
        <el-link :disabled="!allocation.file" type="primary" icon="el-icon-document" :href="allocation.file"
          target="_blank">附件资料</el-link>
        <el-divider>调拨列表</el-divider>
        <el-table :data="allocation.borrowEquipmentAccountVos">
          <el-table-column prop="eaPartInfoVo.equipmentNum" label="设备编号" width="120"></el-table-column>
          <el-table-column prop="eaPartInfoVo.equipmentName" label="设备名称" width="120"></el-table-column>
          <el-table-column prop="eaPartInfoVo.model" label="规格型号"></el-table-column>
          <el-table-column prop="eaPartInfoVo.typeName" label="类别"></el-table-column>
          <el-table-column prop="estimatedReturnTime" label="预计归还时间"></el-table-column>
          <el-table-column label="设备状态">
            <template slot-scope="scope">
              <dict-tag :options="statusDevicedist" :value="scope.row.status" />
            </template>
          </el-table-column>
          <el-table-column prop="userStatusName" label="是否归还">
            <template slot-scope="scope">
              {{ ['是', '否'][scope.row.isReturn] || '-' }}
            </template>
          </el-table-column>
        </el-table>
      </div>
      <div align="center" slot="footer" class="dialog-footer">
        <el-button @click="() => $parent.open = false">关闭</el-button>
      </div>
    </el-dialog>
  </div>
</template>

<script>
import { getChlidrenBorrow } from '@/api/management/management.js'
export default {
  props: ['rowObj'],
  data () {
    return {
      auditData: [],
      islength: true,
      allocation: {},
      gridData: []
    }
  },
  created () {
    this.getlist()
  },
  methods: {
    /**
     * 初始化
     */
    getlist () {
      getChlidrenBorrow(this.rowObj.borrowId).then(res => {//详情接口
        this.allocation = res.data
      })

    }
  }
}
</script>

<style lang="scss" scoped>
.center_dialog {
  // text-align: center;
  width: 80%;
  // padding: 0 10% 0 10%;
  box-sizing: border-box;
  margin: 0px auto;
}

.accep_flex {
  display: flex;
  justify-content: center;
  align-items: center;
}
</style>